﻿using Microsoft.Services.TestTools.UITesting.Html;
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;
using Microsoft.VisualStudio.TestTools.UITesting;
using System.Windows.Input;

namespace TestBing
{

    public partial class Bing : Page
    {
        #region Variables
        private string _textToSearch;

        #endregion

        #region Properties
        public string TextToSearch
        {
            get { return _textToSearch; }
            set { _textToSearch = value; }
        }


        #endregion

        #region Methods
        public void Search()
        {
            HtmlCustom textBoxSearch = Browser.Find<HtmlCustom>(new { Id = "sb_form_q" });

            Keyboard.SendKeys(textBoxSearch, TextToSearch, ModifierKeys.None);
            Browser.Find<HtmlInputButton>(new { Id = "sb_form_go", Title = "Search" }).Click();
        }

        #endregion
    }
}